{extend name="base" /}
{block name="body"}
<div class="layui-layout bg-f8fafc">
    <div class="layui-layout">
        <div class="layui-row yxt-courseinfo">
            <div class="CoursePage_Banner">
                <div class="CoursePage_Banner_Img">
                    <div class="CoursePage_Banner_Mask"></div>
                    <img src="{$info.picture}" alt="{$info.title}">
                </div>
                <div class="layui-container yxt-course-container">
                    <span class="yxt-breadcrumb layui-breadcrumb" lay-separator="—" style="visibility: visible;">
                      <a href="/">首页</a><span lay-separator="">—</span>
                      <a href="">{$info.title}</a>
                    </span>
                    <div class="yxt-course-before layui-row">
                        <div class="pic layui-col-md5 layui-col-xs12">
                            <img  src="{$info.picture}" alt="{$info.title}">
                            <div class="classroom-tag hz-triangle tl0"><span>班级</span></div>
                        </div>
                        <div class="info layui-col-md7 layui-col-xs12 pdl30 pdr20 pdt10 ">
                            <div class="layui-col-md12 mb20">
                                <span class="course-title c-666">{$info.title}</span>
                            </div>
                            <div class="layui-col-md12  c-666 mb20 border-bottom pdb15">
                                <i class="layui-icon layui-icon-user mr10"></i><span class="mr30">学员人数:<span class="ml10">{$info.id|getUserNum=###,3}</span></span>
                                <i class="layui-icon layui-icon-table mr10"></i><span class="mr30">课程数:<span class="ml10">{$info.id|getClassroomCourseNum}</span></span>
                            </div>
                            <div class="layui-col-md12 mb20">
                                <div class="layui-col-md12 c-666 mb20">
                                    <span class="course-teacher">班主任：{$info.headteacher|getTeacherName}</span>
                                </div>
                                <div class="layui-col-md12 c-666 mb20 mt10">
                                    <span class="course-teacher">师资团队：
                                    {foreach name="teacherIds" item="vo"} <a href="{:url('index/teacher/centert',['id'=>$vo])}" alt="{$vo|getTeacherName}"><img src="{$vo|getAvatar|defaultAvatar}" class="layui-nav-img tips" tips="{$vo|getTeacherName}"></a>{/foreach}
                                    </span>
                                </div>
                                {if condition="$isBuy"}
                                <div class="layui-col-md9 c-666 mb20 mt10">
                                    <span class="course-teacher">学习总进度：{$progress}%</span>
                                </div>
                                {/if}
                                {if condition="!$isBuy"}
                                <div class="layui-col-md9 c-666 mb20 mt10">
                                    <span class="course-teacher">价格： <span class="price mr20">{$info.price|isFree}</span>
                                          {$info.id|flashsale=###,3,$info.price,1}
                                    </span>
                                </div>
                                {/if}
                                <div class="layui-col-md3 mt10">
                                    {if condition="$isBuy"}
                                    <a href="javascript:void(0)" class="layui-btn layui-layout-right mt5">已经购买</a>
                                    {elseif condition="$info.status==0" /}
                                    <a class="layui-btn layui-layout-right layui-btn-disabled">班级已关闭</a>
                                    {else /}
                                    <a href="{:url('index/Course/creatorder',['id'=>hashids_encode($info.id),'type'=>hashids_encode(3)])}" class="layui-btn layui-layout-right">加入班级</a>
                                    {/if}
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-container mt30 pdb40">
        <div class="layui-row">
            <div class="yxt_teacher-list">
                <div class="layui-row layui-col-space20">
                    <div class="layui-col-md9 ">
                        <div class="bg-fff layui-tab layui-tab-brief shadow " lay-filter="tab">
                            <ul class="yxt-course-tab-title layui-tab-title">
                                <li class="layui-this" lay-id="1">班级简介</li>
                                <li lay-id="2">课程列表</li>
                                <li lay-id="3">课程评论</li>
                                <li lay-id="4">师资团队</li>
                            </ul>
                            <div class="layui-tab-content">
                                <div class="yxt-course-brief layui-tab-item layui-show">
                                    {$info.brief}
                                </div>
                                <div class="layui-tab-item">
                                    <div class="class-course-list">
                                        {foreach name="liveCourse" item="vo"}
                                        <div class="course-item">
                                            <div class="media">
                                                {if condition="$isBuy"}
                                                <a class="media-left" href="{:url('index/user/mylearn',array('id'=>hashids_encode($vo['id']),'type'=>hashids_encode($vo['type'])))}">
                                                    <img src="{$vo['picture']}" alt="{$vo['title']}" class="">
                                                    <div class="classroom-tag hz-triangle classroom-live-tag"><span>直播</span></div>
                                                </a>
                                                {else /}
                                                <a class="media-left" href="{:url('index/course/info',array('id'=>hashids_encode($vo['id']),'type'=>hashids_encode($vo['type'])))}">
                                                    <img src="{$vo['picture']}" alt="{$vo['title']}" class="">
                                                    <div class="classroom-tag hz-triangle classroom-live-tag"><span>直播</span></div>
                                                </a>
                                                {/if}
                                                <div class="media-body">
                                                    <div class="title">
                                                        <a href="{:url('index/course/info',array('id'=>hashids_encode($vo['id']),'type'=>hashids_encode($vo['type'])))}">
                                                            {$vo['title']}
                                                        </a>
                                                    </div>
                                                    <div class="class-course-price">
                                                        原价：
                                                        <span class="course-price-widget">
                                                            ¥<span class="origin-price">{$vo['price']}</span>
                                                        </span>
                                                    </div>
                                                    {if condition="$isBuy"}
                                                    <div class="class-course-price">
                                                        <div class="layui-progress mt15" lay-showPercent="yes">
                                                            <div class="layui-progress-bar" lay-percent="{$liveProgress[$vo['id']]}%"></div>
                                                        </div>
                                                    </div>
                                                    {/if}
                                                </div>
                                                {if condition="$isBuy"}
                                                <div class=" study-button">
                                                    <a href="{:url('index/user/mylearn',array('id'=>hashids_encode($vo['id']),'type'=>hashids_encode($vo['type'])))}" type="button" class="layui-btn layui-btn-sm">开始学习</a>
                                                </div>
                                                {/if}
                                            </div>
                                        </div>
                                        {/foreach}
                                        {foreach name="videoCourse" item="vo"}
                                        <div class="course-item">
                                            <div class="media">
                                                {if condition="$isBuy"}
                                                <a class="media-left" href="{:url('index/user/mylearn',array('id'=>hashids_encode($vo['id']),'type'=>hashids_encode($vo['type'])))}">
                                                    <img src="{$vo['picture']}" alt="{$vo['title']}" class="">
                                                </a>
                                                {else /}
                                                <a class="media-left" href="{:url('index/course/info',array('id'=>hashids_encode($vo['id']),'type'=>hashids_encode($vo['type'])))}">
                                                    <img src="{$vo['picture']}" alt="{$vo['title']}" class="">
                                                </a>
                                                {/if}
                                                <div class="media-body">
                                                    <div class="title">
                                                        <a href="{:url('index/course/info',array('id'=>hashids_encode($vo['id']),'type'=>hashids_encode($vo['type'])))}">
                                                            {$vo['title']}
                                                        </a>
                                                    </div>
                                                    <div class="class-course-price">
                                                        原价：
                                                        <span class="course-price-widget">
                                                            ¥<span class="origin-price">{$vo['price']}</span>
                                                        </span>
                                                    </div>
                                                    {if condition="$isBuy"}
                                                    <div class="class-course-price">
                                                        <div class="layui-progress mt15" lay-showPercent="yes">
                                                            <div class="layui-progress-bar" lay-percent="{$videoProgress[$vo['id']]}%"></div>
                                                        </div>
                                                    </div>
                                                    {/if}
                                                </div>
                                                {if condition="$isBuy"}
                                                <div class=" study-button">
                                                    <a href="{:url('index/user/mylearn',array('id'=>hashids_encode($vo['id']),'type'=>hashids_encode($vo['type'])))}" type="button" class="layui-btn layui-btn-sm">开始学习</a>
                                                </div>
                                                {/if}
                                            </div>
                                        </div>
                                        {/foreach}
                                    </div>
                                </div>
                                <div class="layui-tab-item">
                                    {foreach name="comment" item="vo" empty="$empty"}
                                    <div class="yxt-card-teacher layui-row border-bottom mt10 ml20">
                                        <div class="pic">
                                            <a  href="#" title=""><img  src="{$vo.uid|getAvatar|defaultAvatar}"></a>
                                        </div>
                                        <div class="comment ">
                                            <div class="user-name c-blue">{$vo.uid|getUserName}<span class="c-999">&nbsp;&nbsp;评论：</span></div>
                                            <div class="comments c-666">{$vo.contents}
                                            </div>
                                        </div>
                                        <div class="of">
                                            <span class="fr mb10">
                                                <font class="fsize12 c-999 ml20">{$vo.addtime}</font>
                                            </span>
                                        </div>
                                    </div>
                                    {/foreach}
                                    <div class="page">{$comment->render()}</div>
                                </div>
                                <div class="layui-tab-item">
                                    <div class="yxt_teacher-list ml20">
                                        <div class="layui-row layui-col-space20">
                                            {foreach name="teachersInfo" item="vo"}
                                            <div class="layui-col-md3 ">
                                                <div class="yxt_teacher-item">
                                                    <div class="teacher-pic" style="cursor: pointer;height:200px">
                                                        <div class="img-box" style="width:110px;height:110px;">
                                                            <a href="{:url('index/teacher/centert',['id'=>$vo.id])}">
                                                                <img src="{$vo.uid|getAvatar|defaultAvatar}" alt="{$vo.username}" width="110" height="110">
                                                            </a>
                                                        </div>
                                                        <p class="teacher-name">{$vo.username}</p>
                                                    </div>
                                                    <p>{$vo.sign}</p>
                                                </div>
                                            </div>
                                            {/foreach}
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md3">
                        <!--<div class="bg-fff layui-card shadow">
                            <div class="layui-card-header c-666">班主任</div>
                            <div class="yxt-card-teacher layui-card-body">
                                <div class="layui-row">
                                    <div class="pic">
                                        <a  href="{:url('index/teacher/centert',['id'=>$teacherInfo.id])}" title=""><img  src="{$teacherInfo.uid|getAvatar|defaultAvatar}"></a>
                                    </div>
                                    <div class="name">
                                        <a class="c-666" href="{:url('index/teacher/centert',['id'=>$teacherInfo.id])}">{$teacherInfo.username}</a>
                                    </div>
                                </div>
                                <div class="layui-row">
                                    <div class="brief c-666">
                                        {$teacherInfo.brief}
                                    </div>
                                </div>
                            </div>
                        </div>-->
                        <div class="bg-fff layui-card shadow">
                            <div class="layui-card-header c-666">班级学员</div>
                            <div class="layui-card-body">
                                <div class="layui-row  xueyuan-list pdt10">
                                    {foreach name="classroomUser" item="vo"}
                                    <div class="layui-col-md2 mb20">
                                        <div class="pic">
                                            <a href="javascript:avoid(0)" title="{$vo.uid|getUserName}"><img src="{$vo.uid|getAvatar|defaultAvatar}"></a>
                                        </div>
                                    </div>
                                    {/foreach}
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="js"}
<script>
    layui.use('util', function(){
        var util = layui.util;
        var endTime = new Date($('#endTime').val()).getTime()
            ,serverTime = new Date($('#nowTime').val()).getTime();
        util.countdown(endTime, serverTime, function(date, serverTime, timer){
            var str= '<span class="layui-badge countdown">'+date[0]+'天</span>';
            str=str+'<span class="layui-badge countdown" >'+date[1]+'时</span>';
            str=str+'<span class="layui-badge countdown" >'+date[2]+'分</span>';
            str=str+'<span class="layui-badge countdown" >'+date[3]+'秒</span>';
            lay('#remain').html(str);
        });
    });
</script>
{/block}